from flask import Blueprint
from .view import *

question_blueprint = Blueprint('question', __name__)

# 添加题目
question_blueprint.add_url_rule(rule="/add", methods=['POST'], view_func=addQuestion)

# 删除题目
question_blueprint.add_url_rule(rule="/delete", methods=['DELETE'], view_func=deleteQuestion)

# 更新题目
question_blueprint.add_url_rule(rule="/update", methods=['POST', 'PUT'], view_func=updateQuestion)

# 获取题目信息
question_blueprint.add_url_rule(rule="get/vo", methods=['GET'], view_func=getQuestionVOById)

# 分页获取题目列表
question_blueprint.add_url_rule(rule="list/page", methods=['POST'], view_func=listQuestionsByPage)

# 分页获取题目列表（封装类）
question_blueprint.add_url_rule(rule="list/page/vo", methods=['POST'], view_func=listQuestionVOByPage)

# 分页获取当前用户创建的题目列表
question_blueprint.add_url_rule(rule="my/list/page/vo", methods=['POST'], view_func=listMyQuestionsByPage)

# 编辑题目
question_blueprint.add_url_rule(rule="edit", methods=['POST'], view_func=editQuestion)

# AI生成题目
question_blueprint.add_url_rule(rule="/AI/add", methods=['POST'], view_func=AIAddQuestion)
